package com.service;

import com.spring.annotation.Autowired;
import com.spring.annotation.Component;
import com.spring.spring_interface.BeanNameAware;
import com.spring.spring_interface.InitializingBean;

//  指定一些名字
@Component("userService")
public class UserService implements BeanNameAware, InitializingBean, UserInterface {
    @Autowired
    private OrderService orderService;


    private String beanName;

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public Object afterPropertiesSet() {
        //  初始化方法
        System.out.println("初始化方法");
        return this;
    }


    public void test() {
//        System.out.println(orderService);
    }


}
